#!usr/bin/env python  
#@time: 2018/01/22 
from urllib import request

with request.urlopen('https://api.douban.com/v2/book/2129650') as f:
    data = f.read()
    print('状态:',f.status, f.reason)
    for k,v in f.getheaders():
        print('%s => %s' %(k,v))
    print('Data:', data.decode('utf-8'))